﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraBars.Helpers;

using DevExpress.XtraTabbedMdi;
using BUS;
using DTO;
using DevExpress.XtraEditors;

namespace QUANLYDETAI
{
    public partial class Form1 : RibbonForm
    {
        public Form1()
        {
            InitializeComponent();
            InitSkinGallery();
            InitGrid();

        }
        void InitSkinGallery()
        {
            SkinHelper.InitSkinGallery(rgbiSkins, true);
        }
        public void InitSkin()
        {
            XtraTabbedMdiManager mdiManager = new XtraTabbedMdiManager();
            mdiManager.MdiParent = this;

        }
        BindingList<Person> gridDataList = new BindingList<Person>();
        void InitGrid()
        {
            gridDataList.Add(new Person("John", "Smith"));
            gridDataList.Add(new Person("Gabriel", "Smith"));
            gridDataList.Add(new Person("Ashley", "Smith", "some comment"));
            gridDataList.Add(new Person("Adrian", "Smith", "some comment"));
            gridDataList.Add(new Person("Gabriella", "Smith", "some comment"));
            //gridControl.DataSource = gridDataList;
        }
        public void addformMain(System.Windows.Forms.Form frm)
        {
            foreach (System.Windows.Forms.Form _mdi in this.MdiChildren)
            {
                if (_mdi.Name == frm.Name)
                    _mdi.Close();
            }
            frm.MdiParent = this;
            frm.Show();
        }
        private void bar_khoa_ItemClick(object sender, ItemClickEventArgs e)
        {
            frm_Khoa frm = new frm_Khoa();
            addformMain(frm);
        }

        private void bar_Chuyennganh_ItemClick(object sender, ItemClickEventArgs e)
        {
            frm_ChuyenNganh frm = new frm_ChuyenNganh();
            addformMain(frm);
        }

        private void bar_Lop_ItemClick(object sender, ItemClickEventArgs e)
        {
            frm_Lopcs frm = new frm_Lopcs();
            addformMain(frm);
        }
    }
}